package cn.blbsz.shop.utils;

import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.sms.model.v20160927.SingleSendSmsRequest;
import com.aliyuncs.sms.model.v20160927.SingleSendSmsResponse;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.exceptions.ServerException;
import com.aliyuncs.profile.DefaultProfile;
import com.aliyuncs.profile.IClientProfile;

public class SMS {

	public static int sendMessege(String telNum,String random) {// TODO 后面设计为传入两个参数其中一个是发短信所需的所有对象
//		try {
//			IClientProfile profile = DefaultProfile.getProfile("cn-hangzhou", "your accessKey", "your accessSecret");
//			DefaultProfile.addEndpoint("cn-hangzhou", "cn-hangzhou", "Sms", "sms.aliyuncs.com");
//			IAcsClient client = new DefaultAcsClient(profile);
//			SingleSendSmsRequest request = new SingleSendSmsRequest();
//			request.setSignName("测试签名");// 控制台创建的签名名称
//			request.setTemplateCode("SMS_111111");// 控制台创建的模板CODE
//			request.setParamString("{\"name\":\"123\"}");// 短信模板中的变量；数字需要转换为字符串；个人用户每个变量长度必须小于15个字符。"
//			// request.setParamString("{}");
//			request.setRecNum(telNum);// 接收号码
//			SingleSendSmsResponse httpResponse = client.getAcsResponse(request);
//		} catch (ServerException e) {
//			e.printStackTrace();
//		} catch (ClientException e) {
//			e.printStackTrace();
//		}
		
		return 1;
	}

	
}
